home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kmimesourcefactory.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-01  |  2.6 KB  |  86 lines

  1. /*
  2.    This file is part of the KDE libraries
  3.    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
  4.    Copyright (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License as published by the Free Software Foundation; either
  9.    version 2 of the License, or (at your option) any later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    Library General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU Library General Public License
  17.    along with this library; see the file COPYING.LIB.  If not, write to
  18.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.    Boston, MA 02110-1301, USA.
  20. */     
  21.  
  22. #ifndef KMIMESOURCEFACTORY_H
  23. #define KMIMESOURCEFACTORY_H
  24.  
  25. #include <qmime.h>
  26. #include <kglobal.h>
  27.  
  28. class KMimeSourceFactoryPrivate;
  29. class KInstance;
  30.  
  31. /**
  32.  * An extension to QMimeSourceFactory that uses KIconLoader to
  33.  * find images.
  34.  *
  35.  * Normally you don't have to instantiate this class at all, KApplication does that for
  36.  * you automagically and sets QMimeSourceFactory::setDefaultFactory().
  37.  *
  38.  * @author Peter Putzer <putzer@kde.org>
  39.  */
  40. class KDECORE_EXPORT KMimeSourceFactory : public QMimeSourceFactory
  41. {
  42. public:
  43.  
  44.   /**
  45.    * Constructor.
  46.    *
  47.    * @param loader is the iconloader used to find images.
  48.    */
  49.   KMimeSourceFactory (KIconLoader* loader = KGlobal::iconLoader());
  50.  
  51.   /**
  52.    * Destructor.
  53.    */
  54.   virtual ~KMimeSourceFactory();
  55.  
  56.   /**
  57.    * This function is maps an absolute or relative name for a resource to 
  58.    * the absolute one.
  59.    *
  60.    * To load an icon, prepend the @p category name before the @p icon name, in the style
  61.    * of \<category>|\<icon>.
  62.    *
  63.    * Example:
  64.    * \code "<img src=\"user|ksysv_start\"/>", "<img src="\desktop|trash\">", ...
  65.    * \endcode
  66.    *
  67.    * @param abs_or_rel_name is the absolute or relative pathname.
  68.    * @param context is the path of the context object for the queried resource. Almost always empty.
  69.    */
  70.   virtual QString makeAbsolute (const QString& abs_or_rel_name, const QString& context) const;
  71.  
  72. protected:
  73.   virtual void virtual_hook( int id, void* data );
  74. private:
  75.   /**
  76.    * @internal
  77.    * Associate with a KInstance so we can pull its iconLoader() when need arises.
  78.    */
  79.   friend class KInstance;
  80.   void setInstance(KInstance *);
  81.  
  82.   KMimeSourceFactoryPrivate* d;
  83. };
  84.  
  85. #endif // KMIMESOURCEFACTORY_H
  86.